/**
 * 
 */
package com.hand.cloud.b2b.daos.impl;

import de.hybris.platform.category.model.CategoryModel;
import de.hybris.platform.servicelayer.ServicelayerTransactionalTest;

import com.hand.cloud.b2b.daos.CategoryDAO;
import com.hand.cloud.b2b.model.EPCatalogModel;
import com.hand.cloud.b2b.model.EPCatalogVersionModel;
import com.hand.cloud.b2b.model.EPCategoryModel;

import javax.annotation.Resource;

import org.junit.Test;
import org.springframework.util.Assert;

/**
 * @author LiuXu
 * @time 2014-8-15 下午2:42:39
 *
 */
public class DefaultCategoryDAOTest extends ServicelayerTransactionalTest
{
    @Resource
    private CategoryDAO categoryDAO;
    
    @Test
    public void test()
    {
   	EPCatalogModel catalog=new EPCatalogModel();
   	catalog.setDefaultCatalog(Boolean.TRUE);
   	catalog.setId("123456789");
   	
   	EPCatalogVersionModel catalogversion=new EPCatalogVersionModel();
   	catalogversion.setInclAssurance(Boolean.TRUE);
   	catalogversion.setInclDuty(Boolean.TRUE);
   	catalogversion.setInclFreight(Boolean.TRUE);
   	catalogversion.setInclPacking(Boolean.TRUE);
   	catalogversion.setVersion("版本1.0.0");
   	catalogversion.setEpCatalog(catalog);
   	
   	EPCategoryModel category=new EPCategoryModel();
   	category.setEpCatalogVersion(catalogversion);
   	category.setCode("handTest");
   	CategoryModel categoryModel=categoryDAO.createCategory(category);
   	System.out.println(categoryModel.getPk());
    }
}
